#include "PyProTk.h"

#include "ProMode.h"

#include "BindFunction.h"
#include "ProWindows.h"
#include "PyProMdl.h"
#include "PyProMessage.h"
#include "PyProUIDialog.h"


PyObject* protkmodule = NULL;



static PyObject*
ExTest(PyObject *self, PyObject *args)
{
	PyErr_SetObject((PyObject *)&pyProErrorType,PyLong_FromLong(-1));
	return NULL;
}

using namespace pyBind;


PyObject* PyProWindowCurrentClose( PyObject *self, PyObject *args )
{
	return PyFun(ProWindowCurrentClose,self,args);
}	

PyObject* PyProModeCurrentGet( PyObject *self, PyObject *args )
{
	return PyFun< Ag<_ret|_adr> >(ProModeCurrentGet,self,args);
}

 
PyObject* PyProWindowActivate( PyObject *self, PyObject *args )
{
	return PyFun< Ag<_in> >(ProWindowActivate,self,args);
}	

PyObject* PyProWindowBrowserSizeGet( PyObject *self, PyObject *args )
{
	return PyFun< Ag<_in> ,Ag<_ret|_adr>  >(ProWindowBrowserSizeGet,self,args);
}

static PyMethodDef ProtkMethods[] = {
	{"ExTest", ExTest, METH_NOARGS,"ExTest"},
	{"ProModeCurrentGet", PyProModeCurrentGet, METH_VARARGS,"ProModeCurrentGet"},
	
	{"ProWindowCurrentClose", PyProWindowCurrentClose, METH_NOARGS,"ProWindowCurrentClose"},
	{"ProWindowActivate", PyProWindowActivate, METH_VARARGS,"ProWindowActivate"},
	{"ProWindowBrowserSizeGet", PyProWindowBrowserSizeGet, METH_VARARGS,"ProWindowBrowserSizeGet"},


	{NULL, NULL, 0, NULL}
};

static PyModuleDef ProtkModule = {
	PyModuleDef_HEAD_INIT, "ProTk", NULL, -1, ProtkMethods,
	NULL, NULL, NULL, NULL
};

PyObject*
PyInit_Protk(void)
{
	protkmodule =  PyModule_Create(&ProtkModule);
	PyInit_ProError_Type(protkmodule);
	PyInit_ProMessage(protkmodule);
	PyInit_ProMdl(protkmodule);
	PyInit_ProUIDialog(protkmodule);

	return protkmodule;
}

